import { ElMessage } from 'element-plus'
import {defineStore} from 'pinia'

import {reqUserLogin} from '../api/login/login'
let useLoginStore = defineStore('login',{
    state:()=>({
        
    }),
    actions:{
       async userLogin(phone,password){
            try {
                await reqUserLogin({phone,password})
                ElMessage({
                    type:'success',
                    message:'登录成功'
                })
            } catch (error) {
                console.log(error);
                
            }
        }
    }
})
export default useLoginStore